package tech.aistar.service.demand.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.entity.CategoryDetail;
import tech.aistar.mapper.deamnd.CategoryDetailMapper;
import tech.aistar.service.demand.ICategoryDetailService;

import java.util.List;

/**
 * Created by 豆梦寒 on 2019/9/27.
 */
@Service
public class CategoryDetailServiceImpl implements ICategoryDetailService {
    @Autowired
    private final CategoryDetailMapper categoryDetailMapper;

    @Autowired
    public CategoryDetailServiceImpl(CategoryDetailMapper categoryDetailMapper) {
        this.categoryDetailMapper = categoryDetailMapper;
    }

    /**
     * 查询所有
     */
    @Override
    public List<CategoryDetail> findAl() {
        List<CategoryDetail> list = categoryDetailMapper.findAl();
        return list;
    }

    @Override
    public List<CategoryDetail> findAll(Integer category_id) {
        List<CategoryDetail> list = categoryDetailMapper.findAll(category_id);
        return list;
    }

    @Override
    public void delByCategoryId(Integer id) {
        categoryDetailMapper.delByCategoryId(id);
    }

    @Override
    public void addByCategoryId(CategoryDetail categoryDetail) {
        categoryDetailMapper.addByCategoryId(categoryDetail);
    }

    @Override
    public void updateCategorydetail(CategoryDetail categoryDetail) {
        categoryDetailMapper.updateCategorydetail(categoryDetail);
    }
}
